package com.kehutong.admin.worker;

import com.coraframework.quartz.Job;
import com.coraframework.quartz.JobExecutionContext;
import com.coraframework.quartz.JobExecutionException;
import com.kehutong.admin.service.AuthService;
import org.coraframework.logger.Logger;
import org.coraframework.logger.LoggerFactory;
import org.coraframework.util.Ioc;

/**
 * 企业过期任务
 *
 * @author wupengfei
 */
public class CorpExpireWorker implements Job {

    private static final Logger logger = LoggerFactory.getLogger(CorpExpireWorker.class);

    private AuthService authService;

    public CorpExpireWorker() {
        this.authService = Ioc.getInstance(AuthService.class);
    }

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            logger.info("CorpExpireWorker");
            authService.createTrialDatabasePool();
        } catch (Exception e) {
            logger.error("企业过期定时任务执行时异常", e);
        }
    }

}
